# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-django-ratelimit
_pkgname=django-ratelimit
pkgver=4.1.0
pkgrel=3
pkgdesc='Cache-based rate-limiting for Django.'
arch=('any')
url='https://pypi.org/project/django-ratelimit/#files'
license=('Apache2')
depends=('python' 'python-django')
makedepends=('python-build' 'python-pip' 'python-wheel')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('20bb7916f01dcf344b1a6966a742f80525f9a1d1aac4dac4f23b0f184bd8bf891aab41db20a30e99c9cf40041d5e1d07159a40f64b7c814d26729cc6a80f0eaa')

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd "$_pkgname-$pkgver"

  pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    $_pkgname
}

